package com.example.demo.controller;

import com.example.demo.mapper.UserMapper;
import com.example.demo.pojo.system.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


//请求处理类
//加上@RestController标识就代表当前类是springboot的请求处理类

@RestController
public class TestController {

    @Resource
    private UserMapper userMapper;


    @GetMapping("/aaa")
    public String test() {

        List<User> userList = userMapper.list();
        userList.stream().forEach(user -> {
            System.out.println(user);
        });
        return "ok";
    }

}
